#ifndef CURVEFACTORY_H
#define CURVEFACTORY_H

#include "Curves/Interfaces/icurve.h"
#include "Curves/CurveUtilities.h"
//#include "Curves/Objects/betaspline.h"
#include "Curves/Objects/bezier.h"
#include "Curves/Objects/ncs.h"
#include "Curves/Objects/nurbs.h"
#include "Curves/Objects/ratbezier.h"

using namespace Utilities;

template< class IPoint >
class CurveFactory
{

public:
    /* Constructors. */
    CurveFactory( );

    /* Methods. */
    ICurve< IPoint >* CreateCurve( CurveType curve_type, int degree );

};

/* Constructors. */
template< class IPoint >
CurveFactory< IPoint >::CurveFactory( )
{
}

/* Methods. */
template< class IPoint >
ICurve< IPoint >* CurveFactory< IPoint >::CreateCurve( CurveType curve_type, int degree = 1.0 )
{
    switch ( curve_type )
    {
        case BezierC:
            return new Bezier< IPoint >( );
            break;

        case RationalBezierC:
            return new RatBezier< IPoint >( );
            break;

        //case BSplineC:
        //    break;

        case NURBSC:
            return new NURBS< IPoint >( degree );
            break;

        case NCSC:
            return new NCS< IPoint >( );
            break;

//        case BetaSplineC:
//            return new BetaSplineC< IPoint >( degree );
//            break;

        default:
            return NULL;
            break;
    }
}


#endif // CURVEFACTORY_H
